import allRouterMap from 'src/api/allRouterMap'


export const createMenu = (menu) => {
  let newMenu = [];
  menu.forEach((item) => {
    let itemObj = allRouterMap[item.code];
    itemObj.meta.title = item.name;
    if (item.children_count > 0) {
      itemObj.children = (createMenu(item.children))
    }
    newMenu.push(itemObj);
  });
  return newMenu
}
